<?php

namespace App\Http\Services;
/*关联用户记录*/

use App\Http\Model\AudioApi;
use App\Http\Model\Config;
use App\Http\Model\HdUser;
use App\Http\Model\User;

class LuckyServices extends CommonServices
{
    private $user_model;
    private $api_model;


    public function __construct()
    {
        $this->user_model = new User();
        $this->api_model = new AudioApi();
    }


    //获取魅力富豪榜
    public function getRank($input = [])
    {
        $data['type'] = 1;
        $data['user_id'] = $input['user_id'] ?? 0;
        $data['page'] = 0;
        $data['page_size'] = 50;
        $data['pre_day_count'] = 50;
        $charmCharts = $this->api_model->getCharmCharts($data);
        $wealthCharts = $this->api_model->getWealthCharts($data);
        $res['charm'] = $charmCharts['data']; //魅力
        $res['wealth'] = $wealthCharts['data'];//富豪
        $date = date('Y-m-d',time());
        if($date == '2019-12-22'){
            $res['wealth']['pre_day_top_three'] = [];
            $res['charm']['pre_day_top_three'] = [];
        }

        return $res;
    }

}